package com.xin.springcloudconsumer.utils;


import com.xin.springcloudconsumer.vo.ResultVO;

/**
 * Created by zz on 2017/7/25.
 */
public class ResultVOUtils {
    /*成功返回对象*/
    public static ResultVO success(Object object){
          ResultVO resultVO=new ResultVO();
          resultVO.setData(object);
          resultVO.setCode(0);
          resultVO.setMessage("成功");
          return resultVO;
    }

    public static ResultVO success(){
         return success(null);
    }
    public static ResultVO success(String msg){
        ResultVO resultVO=new ResultVO();
        resultVO.setData(null);
        resultVO.setCode(0);
        resultVO.setMessage(msg);
        return resultVO;
    }

    public static ResultVO error(Integer code,String msg){
        ResultVO resultVO=new ResultVO();
        resultVO.setCode(code);
        resultVO.setMessage(msg);
        return  resultVO;
    }

}
